import prompt from '@system.prompt'
export default {
    data: {
        title: 'World',
        menuOptions:[
            {
                icon:'/common/icons/right.png',
                content:'demo1'
            },
            {
                icon:'/common/icons/right.png',
                content:'demo2'
            },
            {
                icon:'/common/icons/right.png',
                content:'demo3'
            },
        ],
    },
    change(e){
        prompt.showToast({
            message: "value: " + e.value,
            duration: 3000,
        });
    },
    enterkeyClick(e){
        prompt.showToast({
            message: "enterkey clicked",
            duration: 3000,
        });
    },
//    错误提示
    buttonClick(e){
        this.$element("input").focus({
            focus:false
        })
        this.$element("input").showError({
            error: 'error text'
        });
    },
    checkboxOnChange(e) {
        prompt.showToast({
            message:'checked: ' + e.checked,
            duration: 3000,
        });
    },
    onRadioChange(inputValue, e) {
        if (inputValue === e.value) {
            prompt.showToast({
                message: 'The chosen radio is ' + e.value,
                duration: 3000,
            });
        }
    }
}
